package com.gec.dao;

import java.util.List;

import com.gec.domain.Leave;
import org.apache.ibatis.annotations.Param;



/**
 * @author Aniki
 * @date  2021-12-2
 */
public interface LeaveMapper {
    int addLeave(Leave leave);

    /**---------------------更新相关流程---------------------*/
    int updateAssigneeAndTask(
            @Param("insId")String insId,
            @Param("taskId")String taskId,
            @Param("assignee") String assignee );

    int updateStatus(
            @Param("insId")String insId,
            @Param("status")String status );

    int updateAssigneeByTask(
            @Param("taskId") String taskId,
            @Param("assignee") String assignee );

    int updateStatusByTask(
            @Param("taskId") String taskId,
            @Param("status") String status );

    /**---------------------查询相关流程---------------------*/
    List<Leave> queryMyInitiate(
            @Param("initiator") String initiator );

    List<Leave> queryMyApproved(
            @Param("assignee") String assignee );


    List<Leave> queryWaitMyApprove(
            @Param("assigneeId") String assigneeId );

    Leave queryMyTaskByTaskId(@Param("taskId")String taskId);
}
